package fr.inserm.u674.chcdbweb.model.DTO;

public class TissueType {
	private String tissueTypeID;
	private String tissueTypeDescription;

	/**
	 * Represents the number of tissues with this tissueType
	 */
	private Integer occurrencesInDB;

	public String getTissueTypeID() {
		return tissueTypeID;
	}

	public void setTissueTypeID(String tissueType) {
		this.tissueTypeID = tissueType;
	}

	public String getTissueTypeDescription() {
		return tissueTypeDescription;
	}

	public void setTissueTypeDescription(String description) {
		this.tissueTypeDescription = description;
	}

	public Integer getOccurrencesInDB() {
		return occurrencesInDB;
	}

	public void setOccurrencesInDB(Integer occurrencesInDB) {
		this.occurrencesInDB = occurrencesInDB;
	}

	public String toString() {
		return tissueTypeID;
	}

	public boolean equals(Object obj) {
		if (obj instanceof TissueType && ((TissueType) obj).getTissueTypeID().equals(tissueTypeID)) {
			return true;
		}
		return false;
	}

	public int hashCode() {
		if (tissueTypeID != null)
			return this.getClass().hashCode() + tissueTypeID.hashCode();
		else
			return super.hashCode();
	}

	public TissueType(String tissueType) {
		this.tissueTypeID = tissueType;
	}

	public TissueType(String tissueType, String description) {
		this.tissueTypeID = tissueType;
		this.tissueTypeDescription = description;
	}

}
